# 删除包含特定值的所有列表元素
pets = ['dog','cat','dog','goldfish','dog']
while 'dog' in pets:
    pets.remove('dog')
print(pets)